/**
 * 显示模块数据模型
 */

 module.exports = app => {

  const mongoose = app.mongoose, Schema = mongoose.Schema

  const groupSchema = new Schema({

    // 用户信息
    user: {
      type: Schema.Types.ObjectId,
      ref: 'User'
    },
    
    name: {
      type: String
    },

    // 创建日期
    createdTime: {
      type: Date,
      default: Date.now
    },

    // 修改日期
    upTime: {
      type: Date,
      default: Date.now
    }
  })

  return mongoose.model('Group', groupSchema)
}